
#pragma once

#include "Team.h"

class ServiceProvider;

// TeamManager has the ownership of Teams
class TeamManager
{
public:
	TeamManager(ServiceProvider* const i_sp);
	~TeamManager();

	Team*	GetNewTeam();
	Team*	GetTeamFromID(size_t i_teamID);

	size_t	GetLastID() const;
	size_t	GetNewID();

	void	Clear();
	void	Initialize(const size_t i_startID = 0);
	void	Update() {} // to implement! :)
	void	EndSeasonUpdate() {} // to implement! :)

	const TeamVec& GetTeams() const 
	{
		return m_teams;
	}

private:
	TeamManager(const TeamManager&);
	TeamManager& operator=(const TeamManager&);

	TeamVec m_teams;
	ServiceProvider* m_sp;

	static size_t NUMBERS_OF_TEAMS;
};

inline size_t TeamManager::GetLastID() const
{
	return NUMBERS_OF_TEAMS;
}

inline size_t TeamManager::GetNewID()
{
	return ++NUMBERS_OF_TEAMS;
}
